using System;
using System.Collections.Generic;
using System.Text;

namespace sCicero 
{
    public class word : Base
    {
        public word(ref Data oData)
        {
            m_oData = oData;
        }

        public Errorcode CreateWordDocument()
        {
            Word.ApplicationClass WordApp = new Word.ApplicationClass();
            object missing = System.Reflection.Missing.Value;
            object fileName = "normal.dot"; // template file name
            object newTemplate = false;
            object docType = 0;
            object isVisible = true;
            // Create a new Document, by calling the Add function in the Documents collection
            Word.Document aDoc = WordApp.Documents.Add(ref fileName, ref newTemplate, ref docType, ref isVisible);
            // need to see the created document, so make it visible
            WordApp.Visible = true;
            aDoc.Activate();
            // Global Constant enumerations are members of Word and can be assigned to Properties
            // Set alignment to the center of the document
            WordApp.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;
            // Toggle the title to a Bold Font
            WordApp.Selection.Font.Bold = (int)Word.WdConstants.wdToggle;
            // Type the Text of the Title that was inputted by the user in the Custom Dialog
            WordApp.Selection.TypeText("Hej hopp!!!");
            return Errorcode.NOERROR;
        }
    }
}
